#include "TestState.h"
#include "Game.h"


TestState::TestState(void)
{
}


TestState::~TestState(void)
{
}

void TestState::stateStarted()
{
	Ogre::WindowEventUtilities::addWindowEventListener(Game::getInstance()->mWindow, this->windowEventListener);
	Game::getInstance()->mRoot->addFrameListener(this->frameListener);
	Game::getInstance()->mMouse->setEventCallback(this->MouseListener);
	Game::getInstance()->mKeyboard->setEventCallback(this->keyListener);
}

void TestState::stateEnded()
{

}

void TestState::init()
{
	Game * game =Game::getInstance();
	Light *l = game->mSceneMgr->createLight("MainLight");
	l->setPosition(20,80,50);
	TestListener * lis = new TestListener(game->mRoot,game->mCamera, 
		game->mSceneMgr,game->mWindow,l,game->mMouse,game->mKeyboard,game->mInputManager);
	frameListener = lis;
	keyListener = lis;
	MouseListener = lis;
	windowEventListener=lis;
}
